const moveAboutModel = require("../models/moveAboutModel");
const {getDataByPage} = require("../utils/tools");

// 发布招募信息
exports.createMoveAbout = (moveAboutInfo) => {
    return moveAboutModel.create(moveAboutInfo);
}


// 通过Id获取招募信息
exports.findOneMoveAboutById = (id)=> {
    return moveAboutModel.findOne({
        _id:id
    }).populate("enterprise")
}


// 分页获取招募信息
exports.findMoveAboutByPage = (query)=>{
    return getDataByPage(moveAboutModel,query,"enterprise")
}


// 修改招募信息
exports.updateMoveAbout = (id,moveAboutInfo)=> {
    return moveAboutModel.updateOne({
        _id:id
    },moveAboutInfo)
}
